package chapter2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2019-03-19 下午5:12
 */
public class FunctionTest {
    public static Integer add(Integer x, Integer y) {
        System.out.println("integer");
        return x + y;
    }

    public static final long add(Long x, Long y) {
        System.out.println("Long");
        return x + y;
    }

    public static void main(String[] args) {
        FunctionTest test = new FunctionTest();
        System.out.println(test.add(1, 2));
        System.out.println(add(Integer.valueOf(1), Integer.valueOf(2)));
        System.out.println(test.add(1L, 2L));
    }

    private int add(int x, int y) {
        System.out.println("int");
        return x + y;
    }

    protected synchronized long add(long x, long y) {
        System.out.println("long");
        return x + y;
    }
}
